package org.example;

import Factory.FactoryUserPattern;
import dao.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppUserFactoryDemo {
    public static void main(String[] args) {
       /* FactoryUserPattern factoryUserPattern= new FactoryUserPattern();
        UserDao userDao = factoryUserPattern.createUser();
        userDao.save();*/
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        ctx.registerShutdownHook();
        UserDao userDao = (UserDao) ctx.getBean("userDao1");
        userDao.save();


    }
}
